/**
 * 
 */
package info.niwota.commons.web;

import java.util.HashMap;
import java.util.Map;

/**
 * POJO objects for handling URI's of format /jsonp/<pkg name>/name/method?param0=<json data>
 * 
 * @author qiangli
 * 
 */
public final class AjaxRegistry {
	public static final AjaxRegistry instance = new AjaxRegistry();

	public static final Map<String, Object> entries = new HashMap<String, Object>();

	private AjaxRegistry() {
	}

	public static AjaxRegistry getInstance() {
		return instance;
	}

	public Object add(String name, Object obj) {
		return entries.put(name, obj);
	}

	public Object get(String name) {
		return entries.get(name);
	}

	public Object remove(String name) {
		return entries.remove(name);
	}
	
	public void removeAll() {
		entries.clear();
	}
}
